package com.example.clientb.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class PageController {
    @RequestMapping("/")
    public String indexPage(){
        return "index";
    }

    @RequestMapping("/securedPage")
    public String securedPage(){
        return "securedPage";
    }

    @RequestMapping("/test")
    @PreAuthorize("hasRole('admin')")
    @ResponseBody
    public String test(){
        return "这是client-b上的test接口";
    }
}
